const app = getApp();
import HttpRequst from '../../utils/httpRequst.js'
import API from '../../utils/config.js'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    id:"",
    level:"",
    toggleShowIndex:1,
  
   
    billType:1,
   
    isLoading: false,
    isEnding: false,
    info: ""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that=this;
    this.setData({
      id: options.id,
      level: options.level
    });
    
    HttpRequst(true, API.reportDetail, 1, app.getUkey(), {level:this.data.level,id:this.data.id}, "POST", false, function (res) {
  

      that.setData({
        info:res.data,
        page: that.data.page + 1,
        isEnding: (res.data.bills.length < that.data.pagesize) ? true : false
      })
    })
  },
  toggleShowLog:function(){
    if (this.data.toggleShowIndex == (this.data.info.list.log.length - 1)){
      this.setData({
        toggleShowIndex:1
      })
    }else{
      this.setData({
        toggleShowIndex: this.data.info.list.log.length - 1
      })
    }
  }
  
})